<template>
  <div class="personnel">
    <div class="personnelCon">
      <h1>{{list.xingMing}}</h1>
      <img src="~@/assets/img/personnel.png" alt />
      <div class="affix">
        <div v-for="item in abnormalLists">{{item.title}}</div>
        
      </div>
      <ul>
        <li>
          <div>{{list.xingMing}}</div>
          <div>{{list.phone}}</div>
        </li>
        <li>
          <div>身份证</div>
          <div>{{list.shenFenZhengHao}}</div>
        </li>
        <li>
          <div>地址</div>
          <div>{{list.sheng}} {{list.shi}} {{list.qv}}</div>
        </li>
        <li>
          <div>社区</div>
          <div>{{list.sheQv}}</div>
        </li>
        <li>
          <div>楼宇</div>
          <div>{{list.louYv}}</div>
        </li>
        <li class="add">
          <div>房间</div>
          <div>
            <p style="color:#fff;">{{list.danYuan}}</p>
            <p @click="addData(4)">{{list.fangJian}}</p>
          </div>
        </li>
      </ul>
      <!-- <div class="add">
        <p>{{list.sheQv}}</p>
        <p>{{list.louYv}}</p>
        <p>{{list.danYuan}}</p>
        <p @click="addData(4)">{{list.fangJian}}</p>        
      </div>-->
      <div class="btn">
        <button @click="img">基本信息</button>
        <button>电子病历</button>
        <button>用药记录</button>
      </div>
    </div>
    <v-details :pValue="pValue"  ref="details" :list="list"></v-details>
  </div>
</template>

<script>
import { informationAjax,abnormal } from "@/api/index";
import vDetails from "./details";

export default {
  name: "v-personnel",
  components: { vDetails },
  props: ["valueP"],
  data() {
    return {
      pValue: "",
      list: [],
      abnormalLists:[]
    };
  },
  mounted() {
    this.dataList();
    this.abnormalList();
  },
  methods: {
    img() {
      this.pValue = 2;
    },
    addData(val) {
      this.pValue = val;
       this.$refs.details.room()
    },
    dataList() {
      informationAjax({
        // id: this.idPersonnel.idPersonnel,
        id: "1258711566203768833"
      }).then(res => {
        if (res.success) {
          this.list = res.result;
        }
      });
    },
    abnormalList(){
      abnormal({
        // id:this.idPersonnel.jianKangId,
        id: "1258711586961379329",//健康主键id
        date:""
      }).then(res => {
        if (res.success) {        
          this.abnormalLists = res.result;
        }
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.personnelCon {
  text-align: center;
  position: absolute;
  height: 55vh;
  top: 20%;
  z-index: 301;
  left: 38.2%;
  width: 15%;
  background: #333;
  color: #fff;
  h1 {
    color: #ffffff;
  }
  .affix {
    
  }
  .affix {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
        flex-wrap: wrap;
    div {
      background: chocolate;
      padding: 2px 5px;
      margin-left: 5px;
      border-radius: 3px;
      margin-top: 10px;
    }
  }
  .btn {
    button {
      color: #333;
      margin-left: 10px;
    }
  }
  .add {
    display: flex;
    align-items: center;
    div {
      display: flex;
      align-items: center;
      p {
        margin: 0;
        margin-left: 10px;
        // text-decoration: underline;
        color: deepskyblue;
        cursor: pointer;
      }
    }
  }
  ul {
    li {
      display: flex;
      align-items: center;
      justify-content: center;
      margin-top: 20px;
      div:first-child {
        font-size: 15px;
        font-weight: 800;
        margin-right: 15px;
        width: 20%;
        text-align: left;
      }
      div:last-child {
        width: 70%;
        text-align: left;
      }
    }
  }
}
</style>